#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int s = 0;
int he(int x)
{
	if (x < 10)
		return x;
	else
	{
		int sum = 0;
		 s = x % 10;
		 sum += s;
		 return sum+ he(x / 10);
		
	}
	
}
int main()
{
	int c = 0;
	int n = 0;
	scanf("%d", &n);
	c = he(n);
	printf("%d", c);


	return 0;
}